DevJourney

Python/RegEx/String's Last Word/re.search().py

import re
s = input("Enter statement: ")
res = re.search(r'\w+$',s)
print(res.group())
View on GitHub